<template>
  <section class="jumbotron">
    <h3 class="jumbotron-heading">Search Github Users</h3>
    <div>
      <input type="text" placeholder="enter the name you search" v-model.trim="searchName"/>
      <button @click="search">Search</button>
    </div>
  </section>
</template>

<script>
    export default {
        name: "search",
        data(){
          return {
            searchName:""
          }
        },
        methods:{
          search(){
            //触发$bus的search事件
            this.$bus.$emit("search",this.searchName)
            //清空输入框
            this.searchName = ""
          }
        }
    }
</script>

<style scoped>

</style>
